package day13.Collectionzuoye;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Student {
    private String id;
    private String name;
    private Date birthday;
    private Double score;

    public Student(String id, String name, String birthday, Double score) throws ParseException {
        this.id = id;
        this.name = name;
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        //创建日期值
        this.birthday = dateFormat.parse(birthday);
        this.score = score;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBirthday() {
        DateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
        //创建日期值
        //创建日期、
        String format = dateFormat.format(birthday);
        return format;
    }

    public void setBirthday(String birthday) throws ParseException {
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        //创建日期值
        this.birthday = dateFormat.parse(birthday);
    }

    public Double getScore() {
        return score;
    }

    public void setScore(Double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student [" +
                "id=" + id  +
                ", name=" + name  +
                ", birthday=" + getBirthday() +
                ", score=" + String.format("%.1f", score) +
                ']';
    }
}

class Main {
    public static void main(String[] args) throws ParseException {
        Scanner sc = new Scanner(System.in);
        int i = sc.nextInt();
        Map<String, Student> map = new HashMap<>();
        for (int i1 = 0; i1 < i; i1++) {
            String id = sc.next();
            map.put(id, new Student(id, sc.next(), sc.next(), sc.nextDouble()));
        }
        List<Student> sortedStudents = new ArrayList<>(map.values());
        Collections.sort(sortedStudents, Comparator.comparing(Student::getId));
        for (Student student : sortedStudents) {
            System.out.println(student);
        }
    }
}
